/* eslint-disable jsx-a11y/alt-text */
import React from "react";
import { TopBarSd } from "@/components/main/index/styled";
import { connect } from "react-redux";
import { withRouter } from "react-router-dom";

class TopBar extends React.PureComponent {
    render() {
        return (
            <TopBarSd>
                <span className="city"><button onClick={this.toPath.bind(this)}>{this.props.currentCity.get("name")}</button></span>
                <span className="searchlist"><input type="text" onFocus={this.toSerchPath.bind(this)} placeholder="搜索热门演出" /></span>
                <span className="image"><a href="https://m.juooo.com/Distributor/centre"><img src="https://image.juooo.com/group1/M00/02/65/rAoKmVyvD7iAHJX4AAADmpmoUeI150.png" alt=""/></a></span>
            </TopBarSd>
        )
    }
    toPath() {
        this.props.history.push("/city");
    }
    toSerchPath() {
        this.props.history.push("/serch");
    }
}
const mapStateToProps = state => {
    return {
        currentCity: state.getIn(["indexReducer", "currentCity"])
    };
};
const mapDispatchToProps = dispatch => {
    return {};
};
export default connect(mapStateToProps, mapDispatchToProps)(withRouter(TopBar));